package backend.majiong.yaku.yaku;

import java.util.List;

import backend.MainGame;
import backend.majiong.Pai;
import backend.majiong.Player;
import backend.majiong.yaku.AbstractYaku;
import backend.majiong.yaku.HandCombo;

public class Ryanpeikou extends AbstractYaku {

    @Override
    public boolean checkYaku(Player player, HandCombo combo, MainGame mainGame) {
        if (!combo.getIsMengQing()) {
            return false;
        }
        List<Pai> list = combo.getSunZi();
        if(list.size() < 4) {
            return false;
        }
        this.sortHai(list);
        if(list.get(0).equals(list.get(1)) && list.get(2).equals(list.get(3))) {
            return true;
        }
        
        return false;
    }

    @Override
    public String getYakuName() {
        return "两杯口";
    }

    @Override
    public Integer getYakuNum(boolean isMenQing) {
        return 3;
    }

}
